<template>
	<view class="bannerstyle" v-if="slides && slides.length >0">
		<swiper class="swiper" autoplay="" circular  :interval="4000" >
			<block  v-for="(item,index) in slides" :key="index"> 
			<swiper-item>
				<image class="images" :src="item.pic" alt="" ></image>
			</swiper-item>
			</block>
		</swiper>
	</view>
</template>


<script setup>
	
	import { ref } from 'vue'
	import { onLoad } from '@dcloudio/uni-app'
	import { getBaseInfo } from '@/common/js/api.js'
	const slides = ref([])
	const app = getApp()
	const objarr = ref({id:18,pic:"https://cdn.asiatop.net/ry-test/2024/02/27/e9446d2c2d4240e984aa6ab9a54197d6.png"})
	onLoad(()=>{
		// 优化 增加一张轮播图
		// getBaseInfo({ terminal: 'WECHAT' }).then((res) => { slides.value = [...res.data, objarr.value]})
		
		getBaseInfo({terminal:'H5'}).then((res) => { slides.value = res.data; slides.value.push(objarr.value)})
		
		
	})
</script>
<style>
	.bannerstyle{
	/* 	margin: 25rpx ; */
		padding-top:20rpx;
		border-radius:50px
	}
	.swiper{
		width: 100%;
		height: 360rpx;
	}
	.images{
		width: 100%;
		height: 100%;
		border-radius: 20rpx;
		
	}
	
</style>
